//
//  LFTitleBtn.swift
//  SDAutoWeibo
//
//  Created by 刘健 on 16/3/24.
//  Copyright © 2016年 Clemmie. All rights reserved.
//

import UIKit

class LFTitleBtn: UIButton {
    
    convenience init(image: String, title: String) {
        self.init()
        setImage(UIImage(named: image), forState: UIControlState.Normal)
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        sizeToFit()
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        
//        imageView?.origin.x = titleLabel!.frame.width + 3
//        
        titleLabel?.frame.origin.x = 0
        imageEdgeInsets = UIEdgeInsetsMake(0, titleLabel!.frame.width + 3, 0, 0)
//        titleLabel?.origin.x = 0
    }

}
